import httpFetch from 'share/httpFetch';
import errorMessage from 'share/errorMessage';

export default {
  // 查询审核配置
  getAuditBasisConfig(page, size, params) {
    return httpFetch.post(`/api/review/baseconfig/query?page=${page}&size=${size}`, params)
      .catch(err => {
        errorMessage(err.response);
      });
  },
  // 根据id删除配置
  deleteAuditBasisConfig(id) {
    return httpFetch.delete(`/api/review/baseconfig/${id}`)
      .catch(err => {
        errorMessage(err.response);
        throw err;
      });
  },
  // 保存配置
  saveAuditBasisConfig(params) {
    return httpFetch.post(`/api/review/baseconfig`, params)
      .catch(err => {
        errorMessage(err.response);
        throw err;
      });
  },

  // 查询记账日期落值配置
  getBookDateList(page, size, params) {
    return httpFetch.post(`/api/book/date/config/query?page=${page}&size=${size}`, params)
  },

  // 保存记账日期落值配置
  saveBookDate(params) {
    return httpFetch.post(`/api/book/date/config/save`, params)
      .catch(err => {
        errorMessage(err.response);
        throw err;
      });
  },

  // 删除记账日期落值配置
  deleteBookDate(configId) {
    return httpFetch.delete(`/api/book/date/config/${configId}`)
      .catch(err => {
        errorMessage(err.response);
        throw err;
      });
  },

};
